import { NQrCode } from "naive-ui";
import type { QrCodeProps } from "naive-ui";
import type { HTMLAttributes } from "vue";
export type QrCodeFactoryConstructorType = {
  props?: QrCodeProps;
  attrs?: HTMLAttributes;
};
export class QRCodeFactory {
  private props: QrCodeProps = {};
  private attrs: HTMLAttributes = {};

  constructor(data?: QrCodeFactoryConstructorType) {
    if (data?.props) this.setProps(data.props);
    if (data?.attrs) this.setAttrs(data.attrs);
  }
  setProps(props: QrCodeProps) {
    this.props = props;
    return this;
  }

  setAttrs(attrs: HTMLAttributes) {
    this.attrs = attrs;
    return this;
  }
  create() {
    return <NQrCode {...this.props} {...this.attrs} />;
  }
}
